using System;
using System.Collections.Generic;
using Library;
using Library.Util;
using NHibernate;

namespace Library.Persistence.Cloud.Dao
{
	public class CloudFirmaBirimDao : BaseEntity
	{
		private readonly string fromHql = " from CloudFirmaBirim as t ";
		public void Insert(CloudFirmaBirim dto)
		{
			BasePersistence.Insert(dto);
		}

		public void Update(CloudFirmaBirim dto)
		{
			BasePersistence.Update(dto);
		}

		public void Delete(CloudFirmaBirim dto)
		{
			BasePersistence.Delete(dto);
		}

		public void Delete(int firmaBirimId)
		{
			CloudFirmaBirim dto = new CloudFirmaBirim();
			dto.FirmaBirimId = firmaBirimId;
			Delete(dto);
		}

		public CloudFirmaBirim Get(int firmaBirimId, LockMode lockMode)
		{
			return Get<CloudFirmaBirim>(firmaBirimId, lockMode);
		}

		public List<CloudFirmaBirim> FindAll()
		{
			return Find<CloudFirmaBirim>(fromHql, LockMode.Read);
		}

		public List<CloudFirmaBirim> FindAll(string orderStatement)
		{
			return Find<CloudFirmaBirim>(fromHql + " ORDER BY " + orderStatement, LockMode.Read);
		}

	}
}
